package phyml.view;

import javax.swing.*;
import java.awt.*;

/**
 * Project: grisu
 * <p/>
 * Written by: Markus Binsteiner
 * Date: 19/08/13
 * Time: 12:27 PM
 */
public class PhyMLNeSIOptionsPanel {

    private JPanel rootPanel;
    private JPanel loginPanel;
    private JPanel loggedInPanel;


    private void createUIComponents() {

        NeSILoginPanel temp = new NeSILoginPanel();
        loginPanel = temp.getPanel();
        NesiSubmitPanel temp2 = new NesiSubmitPanel();
        loggedInPanel = temp2.getPanel();

    }

    public JPanel getPanel() {
        return rootPanel;
    }

    public void switchTo(final String panelToDisplay) {

        SwingUtilities.invokeLater(new Thread() {
            public void run() {
                CardLayout cl = (CardLayout) (rootPanel.getLayout());
                cl.show(rootPanel, panelToDisplay);
            }
        });
    }

    {
// GUI initializer generated by IntelliJ IDEA GUI Designer
// >>> IMPORTANT!! <<<
// DO NOT EDIT OR ADD ANY CODE HERE!
        $$$setupUI$$$();
    }

    /**
     * Method generated by IntelliJ IDEA GUI Designer
     * >>> IMPORTANT!! <<<
     * DO NOT edit this method OR call it in your code!
     *
     * @noinspection ALL
     */
    private void $$$setupUI$$$() {
        createUIComponents();
        rootPanel = new JPanel();
        rootPanel.setLayout(new CardLayout(0, 0));
        rootPanel.add(loginPanel, "LOGIN");
        rootPanel.add(loggedInPanel, "READY");
    }

    /**
     * @noinspection ALL
     */
    public JComponent $$$getRootComponent$$$() {
        return rootPanel;
    }
}
